using Avalonia.Data.Converters;
using System;
using System.Diagnostics;
using System.Globalization;

namespace DesktopApp.Converters
{
    public class StringIsNotNullOrEmptyConverter : IValueConverter
    {
        public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
        {
            string? strValue = value as string;
            bool result = !string.IsNullOrEmpty(strValue);
            Debug.WriteLine($"[StringIsNotNullOrEmptyConverter] Input: '{strValue ?? "null"}', Output: {result}");
            return result;
        }

        public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
        {
            throw new NotImplementedException(); // Not typically needed for IsEnabled bindings
        }
    }
} 